<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<s:if test="hasActionErrors()">
	<span class="errors"><s:actionerror /></span>
</s:if>

<div id="rightPan">
	<div id="rightbodyPan">
		<div align="center"><p style=" font-size: 24px; padding: 10px 0 5px 0;" >สั่งซื้อสินค้า</p></div>

		<script type="text/javascript">
			function finish()
			{
				document.getElementById( 'order_finishT' ).submit();
			}
		</script>

		<table width="100%" border="0">
			<tr>
				<td width="33%"><div align="center">
						<img src="../images/check-green.jpg" width="50" height="50" border="0" usemap="#checkMap" />
			  </div></td>
				<td width="33%"><div align="center">
						<img src="../images/check-blue.jpg" width="50" height="50" border="0" usemap="#confirmMap" />
			  </div></td>
				<td width="34%"><div align="center">
						<img src="../images/check-black.jpg" width="50" height="50" border="0" usemap="#finishMap" />
			  </div></td>
			</tr>
			<tr>
				<td width="33%"><div align="center">ตรวจสอบรายการสั่งซื้อสินค้า</div></td>
				<td width="33%"><div align="center">ยืนยันการสั่งซื้อ<br/>ตรวจสอบที่อยู่ที่ใช้ในการจัดส่ง</div></td>
				<td width="34%"><div align="center">การสั่งซื้อเสร็จสมบูรณ์</div></td>
			</tr>
		</table>
		<hr/>

		<s:form id="order_confirmT" action="order_confirmT" theme="simple">
			<s:iterator value="orderToolList">
	  			<tr>
	  				<td colspan="4"><div align="left"><p id="productName"><s:property value="name"/></p></div></td>
	  			</tr>
	  			<tr>
	  				<td colspan="4"><div align="left"><p id="productDesc"><s:property value="description"/></p></div></td>
	  			</tr>
	  			<tr align="center">
	  				<s:set var="varUrl" value="imageName"/>
	  				<td colspan="4"><div align="center">
	  				<img src="<s:url value="/images/product/%{varUrl}"/>" width="50%" height="50%"/></div></td>
	  			</tr>
	  			<tr>
	  				<td></td>
  					<table width="100%">
  						<tr>
  							<td width="25%"></td>
  							<td width="25%"><p id="productCalc">ราคา(บาท)</p></td>
  							<td width="25%"><p id="productCalc">จำนวน(ชิ้น)</p></td>
  							<td width="25%"><p id="productCalc">ราคารวม (บาท)</p></td>
  						</tr>
						<tr>
							<td width="25%"></td>
							<td width="25%"><p id="productDetail"><s:label key="currencyPrice"/></p></td>
							<td width="25%"><p id="productDetail"><s:label key="amount"/></p></td>
							<td width="25%"><p id="productDetail"><s:label key="currencyTotalPrice"/></p></td>
						</tr>
  					</table>
	  			</tr>
			</s:iterator>
			<hr/>
			
			<td width="100%"><div align="right"><p style=" font-size: 14px; padding: 10px 0 0 0; ">
			ภาษี 7% <s:label key="orderForm.currencyTax"/> บาท</p></div></td>
			<td width="100%"><div align="right"><p style=" font-size: 14px; padding: 10px 0 0 0; ">
			ราคาสินค้า <s:label key="orderForm.currencyTotalPriceBeforeTax"/> บาท</p></div></td>
			<td width="100%"><div align="right"><p style=" font-size: 16px; font-weight: bold; padding: 10px 0 0 0; ">
			ราคารวมทั้งหมด <s:label key="orderForm.currencySumTotalPrice"/> บาท</p></div></td>
			<hr/>
			<div align="center"><p style=" font-size: 16px; font-weight: bold; padding: 10px 0 5px 0;">
			ผู้สั่งซื้อ และที่อยู่ที่ใช้ในการจัดส่งสินค้า</p></div>
			<table>
				<tr>
					<td id="slabel" style="padding-top: 10px;">ชื่อ:</td>
					<td style="padding-top: 10px;"><s:textfield
							value="%{#session.MEMBER.first_Name}" name="memberForm.first_Name" size="25" id="first_Name"></s:textfield></td>
				</tr>
				<tr>
					<td id="slabel">นามสกุล:</td>
					<td><s:textfield value="%{#session.MEMBER.last_Name}"
							name="memberForm.last_Name" size="25" id="lastName"></s:textfield></td>
				</tr>
				<tr>
					<td id="slabel">อีเมล์:</td>
					<td><s:textfield value="%{#session.MEMBER.email}"
							name="memberForm.email" size="40" id="email"></s:textfield></td>
				</tr>
				<tr>
					<td id="slabel">เบอร์โทร:</td>
					<td><s:textfield value="%{#session.MEMBER.telephone}" id="telephone"
							name="memberForm.telephone" size="25"></s:textfield></td>
				</tr>
				<tr>
					<td id="slabel">ที่อยู่:</td>
					<td><s:textfield value="%{#session.MEMBER.address_Line1}" id="address_Line1"
							name="memberForm.address_Line1" size="50"></s:textfield></td>
				</tr>
				<tr>
					<td></td>
					<td><s:textfield value="%{#session.MEMBER.address_Line2}" id="address_Line2"
							name="memberForm.address_Line2" size="50"></s:textfield></td>
				</tr>
				<tr>
					<td></td>
					<td><s:textfield value="%{#session.MEMBER.address_Line3}" id="address_Line3"
							name="memberForm.address_Line3" size="50"></s:textfield></td>
				</tr>
				<tr>
					<td></td>
					<td><s:textfield value="%{#session.MEMBER.address_Line4}" id="address_Line4"
							name="memberForm.address_Line4" size="50"></s:textfield></td>
				</tr>
				<tr>
					<td id="slabel">รหัสไปรษณีย์:</td>
					<td><s:textfield value="%{#session.MEMBER.post_Code}" id="post_Code"
							name="memberForm.post_Code" size="15"></s:textfield></td>
				</tr>
			</table>
			
		</s:form>
		
		<s:form action="order_finishT" theme="simple">
			<input onclick="finish()" type="button" value="ยืนยัน" id="button"
			style="margin: 30px 0 0 240px; width: 90px;"></input>		
		</s:form>
		
	</div>
</div>

<map name="checkMap" id="checkMap"><area shape="circle" coords="25,25,20" href="<s:url action="order_check" namespace="/order"/>"/></map>
<map name="confirmMap" id="confirmMap"><area shape="circle" coords="24,25,21" href="<s:url action="order_confirm" namespace="/order"/>" /></map>
<map name="finishMap" id="finishMap"><area shape="circle" coords="24,26,22" href="<s:url action="order_finish" namespace="/order"/>" /></map>

